package com.cfg.domain;

import com.common.constant.UserConstants;
import com.common.core.domain.entity.SysDept;
import com.common.core.domain.entity.SysMenu;
import com.common.utils.StringUtils;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Treeselect树结构实体类
 * 
 * @author ruoyi
 */
@Data
public class CfgTreeSelect implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 节点ID */
    private String id;

    /** 节点名称 */
    private String label;

    /** 节点名称 */
    private String labelLocal;


    /** 子节点 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<CfgTreeSelect> children;

    public CfgTreeSelect()
    {

    }

    public CfgTreeSelect(SimpleCfgCategoryMapping simpleCfgCategoryMapping)
    {
        this.id = simpleCfgCategoryMapping.getCodeColumn();
        this.label = simpleCfgCategoryMapping.getValueColumn();
        this.labelLocal=simpleCfgCategoryMapping.getValueColumnLocal();
        this.children = simpleCfgCategoryMapping.getChildren().stream().map(CfgTreeSelect::new).collect(Collectors.toList());
    }



}
